cmake_minimum_required(VERSION 3.8)
project(r)

include(rcmakefunction/CMakeListsFunc.cmake)

set(CMAKE_CXX_STANDARD 20)

set(CMAKE_CXX_FLAGS "-g -O2 -Werror")


MakeProtocol(rproto)

include_directories("/usr/include")
include_directories("/usr/local/include")

SearchIncludeDir(rproto)
SearchIncludeDir(rafw)
SearchIncludeDir(rlog)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
    SearchIncludeDir("ree/eqengine")
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
    SearchIncludeDir("ree/kqengine")
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
    SearchIncludeDir("ree/kqengine")
endif()

add_subdirectory(rproto)
add_subdirectory(ree)
add_subdirectory(rafw)
add_subdirectory(rlog)


SearchIncludeDir(src)
add_subdirectory(src)
